Skip to content

test: cache fixture PDFs so CI does not depend on external servers - #106

Merged
perrette merged 1 commit into
masterfrom
ci/cache-test-pdfs
Jun 9, 2026
Merged

test: cache fixture PDFs so CI does not depend on external servers#106
perrette merged 1 commit into
masterfrom
ci/cache-test-pdfs

Conversation

@perrette

@perrette perrette commented Jun 9, 2026

Copy link
Copy Markdown
Owner

Problem

CI has been failing on tests/test_add.py::TestAdd::test_add on unrelated (docs-only) commits. The cause is not a code bug — the test suite's setUp downloads sample PDFs from the publisher servers (biogeosciences.netbg.copernicus.org) on every run via tests/download.py. Those servers have become unreliable:

  • ConnectionResetError [Errno 104] Connection reset by peer
  • http.client.IncompleteRead (across all 7 Python versions)

Because pytest runs with -x, this single networked fixture aborts the entire suite.

Fix

Commit the three stable fixture PDFs so _downloadpdf() finds them already present and skips the network entirely:

  • Un-ignore the three known fixtures in tests/downloadedpapers/.gitignore (stray downloads stay ignored).
  • Add bg-8-515-2011.pdf, esd-4-11-2013.pdf, esd-4-11-2013-supplement.pdf (~14 MB total).

Verified locally with the network fully blocked: all three fixtures resolve from cache, no connection attempted.

Tradeoff

Adds ~14 MB of binaries to git history. The alternative (GitHub Actions cache) still hits the flaky server on a cache miss, so vendoring is the more robust fix.

The test suite downloaded sample PDFs from the publisher servers
(biogeosciences.net / copernicus.org) on every run via tests/download.py.
Those servers are flaky and have started resetting connections and
returning IncompleteRead, failing CI on unrelated (docs-only) commits.

Commit the three stable fixture PDFs so _downloadpdf() finds them already
present and skips the network entirely. The inner .gitignore still ignores
any other stray downloaded PDFs.
@perrette
perrette merged commit 4d98ae3 into master Jun 9, 2026
14 checks passed
@perrette
perrette deleted the ci/cache-test-pdfs branch June 9, 2026 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant